/*
 * @Description: 购票记录列表组件
 * @Author: shuaishuai.wang
 * @Date: 2019-08-21 09:57:04
 * @Last Modified by: ziwei.ma
 * @Last Modified time: 2019-10-28 18:09:52
 */
<template>
  <div class="list_main">
    <!-- <xb-scroll
      ref="scroll"
      :getListData="getRecordList"
      :up="up"
    > -->
    <div class="record_list">
      <record-item
        v-for="(record, index) in recordList"
        :key="index"
        :record="record"
      ></record-item>
    </div>
    <!-- </xb-scroll> -->
  </div>
</template>

<script>
import { XBScroll } from 'vue-xb-ui-depot'
// import { getOrderList } from './../../interface/getInterface'
export default {
  components: {
    'xb-scroll': XBScroll
  },
  props: {
    recordList: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data() {
    return {
      // recordList: [], // 购票记录数据
      up: {
        noMoreSize: 21,
        page: { size: 20 }
      },
      recordData: {}
      // busList: []
    }
  },
  mounted() {
    // getOrderList({}).then(data => {
    //   console.log(data)
    //   this.$emit('closeLoading')
    //   this.recordList = data.LIST
    //   this.$emit('recordData', data.LIST)
    // }).catch(err => {
    //   console.log(err)
    //   this.$emit('loadingFail')
    // })
  },
  methods: {
    // getRecordList(PAGE_INDEX, PAGE_CAPACITY) {
    //   return getOrderList({ PAGE_INDEX: 1, PAGE_CAPACITY: 10 }).then(res => {
    //     if (res.COUNT === 0) {
    //       return { length: PAGE_CAPACITY, count: 1 }
    //     } else {
    //       this.recordList = PAGE_INDEX === 1 ? res.LIST : this.recordList.concat(res.LIST)
    //       return { length: PAGE_CAPACITY, count: res.COUNT }
    //     }
    //   }).catch(err => {
    //     console.warn(err)
    //   })
    // }
  }
}
</script>

<style lang="scss" scoped>
.list_main {
  padding-top: 32px;
  // margin-bottom: 100px;
}
</style>
